package com.kkelectronics.w2b.beangen.service.model;

public class BeanField {

	private final String name;
	private String typeName;
	private String typeShortName;
	private String comment;

	private boolean useInEquals = false;
	private boolean useInHashCode = false;
	private boolean useInToString = false;

	private boolean isRawType = false;

	public BeanField(String name) {
		super();
		this.name = name;
	}

	public String getTypeName() {
		return typeName;
	}

	public void setTypeName(String typeName) {
		this.typeName = typeName;
	}

	public String getTypeShortName() {
		return typeShortName;
	}

	public void setTypeShortName(String typeShortName) {
		this.typeShortName = typeShortName;
	}

	public String getComment() {
		return comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}

	public boolean isUseInEquals() {
		return useInEquals;
	}

	public void setUseInEquals(boolean useInEquals) {
		this.useInEquals = useInEquals;
	}

	public boolean isUseInHashCode() {
		return useInHashCode;
	}

	public void setUseInHashCode(boolean useInHashCode) {
		this.useInHashCode = useInHashCode;
	}

	public boolean isUseInToString() {
		return useInToString;
	}

	public void setUseInToString(boolean useInToString) {
		this.useInToString = useInToString;
	}

	public String getName() {
		return name;
	}

	public boolean isRawType() {
		return isRawType;
	}

	public void setRawType(boolean isRawType) {
		this.isRawType = isRawType;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((comment == null) ? 0 : comment.hashCode());
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		result = prime * result + ((typeName == null) ? 0 : typeName.hashCode());
		result = prime * result + ((typeShortName == null) ? 0 : typeShortName.hashCode());
		result = prime * result + (useInEquals ? 1231 : 1237);
		result = prime * result + (useInHashCode ? 1231 : 1237);
		result = prime * result + (useInToString ? 1231 : 1237);
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		BeanField other = (BeanField) obj;
		if (comment == null) {
			if (other.comment != null)
				return false;
		} else if (!comment.equals(other.comment))
			return false;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		if (typeName == null) {
			if (other.typeName != null)
				return false;
		} else if (!typeName.equals(other.typeName))
			return false;
		if (typeShortName == null) {
			if (other.typeShortName != null)
				return false;
		} else if (!typeShortName.equals(other.typeShortName))
			return false;
		if (useInEquals != other.useInEquals)
			return false;
		if (useInHashCode != other.useInHashCode)
			return false;
		if (useInToString != other.useInToString)
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "BeanField [name=" + name + ", typeName=" + typeName + ", typeShortName=" + typeShortName + ", comment=" + comment + ", useInEquals=" + useInEquals
				+ ", useInHashCode=" + useInHashCode + ", useInToString=" + useInToString + "]";
	}

}
